package com.homework8;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;

public class demo {
    public static void main(String[] args) throws IOException {
        //将内存的东西存到硬盘中 输出流
        FileWriter fileWriter=new FileWriter(("E:\\东方标准\\JAVASE阶段\\JAVASE-CODE\\Day18\\info.txt"),true);
        while (true){
            String s = new Scanner(System.in).nextLine();
            if(s.equals("886")){
                System.out.println("信息以保存，系统正在退出");
                System.exit(0);
            }else {
//                String[] arr=new String[100];
//                arr[arr.length]=s;
                fileWriter.write(s+"\r\n");
                fileWriter.flush();
            }
        }
    }
}
